home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
game
/
patch
/
WHDIGamesS-T.lzh
/
Spellbound.lha
/
Install
< prev
next >
Wrap
Text File
|
1980-01-08
|
3KB
|
156 lines
;**************************** ;Spellbound installer by Galahad
(set #sub-dir "data") ;sub directory containing data files
(set #readme-file "ReadMe") ;name of readme file
(set #cleanup "") ;files to delete after install
;****************************
;----------------------------
; checks if given program is installed, if not abort install
; #program - to check
(procedure P_ChkRun
(if
(= 0 (run ("cd SYS:\nWhich %s" #program)))
("")
(abort
(cat
"You must install \"" #program "\" first!\n"
"It must be accessible via the path.\n"
"You can find it in the WHDLoad package."
)
)
)
)
;----------------------------
; Wait for inserting disk
; IN: #AD_disk - name of disk
; OUT: -
(procedure P_disk
(askdisk
(dest #AD_disk)
(prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
(help @askdisk-help)
)
)
;****************************
(if
(exists #readme-file)
(if
(= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
("")
(run ("SYS:Utilities/More %s" #readme-file))
)
)
(set #program "WHDLoad")
(P_ChkRun)
(set @default-dest
(askdir
(prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
(help @askdir-help)
(default @default-dest)
(disk)
)
)
(set #dest (tackon @default-dest @app-name))
(if
(exists #dest)
(
(set #choice
(askbool
(prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
(default 1)
(choices "Delete" "Skip")
(help @askbool-help)
)
)
(if
(= #choice 1)
(run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
)
)
)
(makedir #dest
(help @makedir-help)
(infos)
)
;----------------------------
(copyfiles
(help @copyfiles-help)
(source ("Spellbound.Slave"))
(dest #dest)
)
(copyfiles
(help @copyfiles-help)
(source ("Spellbound.info"))
(dest #dest)
)
(copyfiles
(help @copyfiles-help)
(source ("Imager"))
(dest #dest)
)
(if
(exists #readme-file)
(copyfiles
(help @copyfiles-help)
(source #readme-file)
(dest #dest)
)
)
(if
(exists ("%s.info" #readme-file))
(
(copyfiles
(help @copyfiles-help)
(source ("%s.info" #readme-file))
(dest #dest)
)
(tooltype
(dest (tackon #dest #readme-file))
(noposition)
)
)
)
(if
(= #sub-dir "")
("")
(
(set #dest (tackon #dest #sub-dir))
(makedir #dest
(help @makedir-help)
)
)
)
;----------------------------
(run
(cat
"cd \"" #dest "\"\n")
)
(run ("Imager")
)
(copyfiles
(help @copyfiles-help)
(source ("RAM:"))
(dest #dest)
(pattern "GLDFLT.#?") ;Copy files created by Imager!
)
;----------------------------
(run ("Delete RAM:GLDFLT.#? ALL QUIET FORCE" #cleanup))
(exit)